ErrorLevel("off")
MortScript = "\DiskOnChip\MortScript"
BACKUP_PATH = "\Storage Card\InstallSD\BackupBDR"
STANDARD_MEMORY = 5000
Delete( "\Windows\Startup\CheckDiagnostic.lnk")
SetChoiceEntryFormat(31, 20, "Arial")
ChoiceDefault("Choix du GPS", " ", 1, 0, "X950", "X930A", "X930B")
case 1
Delete("\Storage Card\InstallSD\BackupBDR\backup.rbk")
Copy("\Storage Card\InstallSD\BackupBDR\X950\backup.rbk", "\Storage Card\InstallSD\BackupBDR\backup.rbk")
Delete("\Windows\GX_HPC.INI")
Copy("\Storage Card\InstallSD\BackupBDR\X950\GX_HPC.INI", "\Windows\GX_HPC.INI")
case 2
Delete("\Storage Card\InstallSD\BackupBDR\backup.rbk")
Copy("\Storage Card\InstallSD\BackupBDR\X930A\backup.rbk", "\Storage Card\InstallSD\BackupBDR\backup.rbk")
Delete("\Windows\GX_HPC.INI")
Copy("\Storage Card\InstallSD\BackupBDR\X930A\GX_HPC.INI", "\Windows\GX_HPC.INI")
case 3
Delete("\Storage Card\InstallSD\BackupBDR\backup.rbk")
Copy("\Storage Card\InstallSD\BackupBDR\X930B\backup.rbk", "\Storage Card\InstallSD\BackupBDR\backup.rbk")
Delete("\Windows\GX_HPC.INI")
Copy("\Storage Card\InstallSD\BackupBDR\X930B\GX_HPC.INI", "\Windows\GX_HPC.INI")
EndChoice
If(fileExists("\Storage Card\N100\MainPage.exe"))
SetChoiceEntryFormat(31, 20, "Arial")
ChoiceDefault(" Interface Options", " ", 1, 0, "Interface SI", "Interface N100")
case 1
Delete("\Windows\background.bmp")
Delete("\Windows\PNDbackground.bmp")
Delete("\DiskOnChip\Scripts\powerall.mscr")
Delete("\DiskOnChip\SI\SysInfoSettings.ini")
Copy("\DiskOnChip\Scripts\SI.lnk", "\Windows\StartUp\SI.lnk")
Copy("\DiskOnChip\Scripts\SI.lnk", "\Windows\Desktop\SI.lnk")
Copy("\DiskOnChip\Scripts\pallsi\powerall.mscr", "\DiskOnChip\Scripts\powerall.mscr")
Delete("\Windows\StartUp\N100.lnk")
Delete("\Windows\Desktop\N100.lnk")
Copy("\DiskOnChip\SI\SysInfoSettings\MECA\SysInfoSettings.ini", "\DiskOnChip\SI\SysInfoSettings.ini")
Copy("\DiskOnChip\SI\Skins\MECA\background.bmp", "\Windows\background.bmp")
Copy("\DiskOnChip\SI\Skins\MECA\PNDbackground.bmp", "\Windows\PNDbackground.bmp")
case 2
Delete("\Windows\background.bmp")
Delete("\Windows\PNDbackground.bmp")
Delete("\DiskOnChip\Scripts\powerall.mscr")
Copy("\DiskOnChip\Scripts\N100.lnk", "\Windows\StartUp\N100.lnk")
Copy("\DiskOnChip\Scripts\N100.lnk", "\Windows\Desktop\N100.lnk")
Copy("\Storage card\N100\MN6.mscr", "\Windows\MN6.mscr")
Copy("\Storage card\N100\MN6.exe", "\Windows\MN6.exe")
Copy("\DiskOnChip\Scripts\palln100\powerall.mscr", "\DiskOnChip\Scripts\powerall.mscr")
Delete("\Windows\StartUp\SI.lnk")
Delete("\Windows\Desktop\SI.lnk")
Copy("\Storage Card\N100\background.bmp", "\Windows\background.bmp")
Copy("\Storage Card\N100\PNDbackground.bmp", "\Windows\PNDbackground.bmp")
EndChoice
Else
Delete("\Windows\background.bmp")
Delete("\Windows\PNDbackground.bmp")
Delete("\DiskOnChip\Scripts\powerall.mscr")
Delete("\DiskOnChip\SI\SysInfoSettings.ini")
Copy("\DiskOnChip\Scripts\SI.lnk", "\Windows\StartUp\SI.lnk")
Copy("\DiskOnChip\Scripts\SI.lnk", "\Windows\Desktop\SI.lnk")
Copy("\DiskOnChip\Scripts\pallsi\powerall.mscr", "\DiskOnChip\Scripts\powerall.mscr")
Delete("\Windows\StartUp\N100.lnk")
Delete("\Windows\Desktop\N100.lnk")
Copy("\DiskOnChip\SI\SysInfoSettings\MECA\SysInfoSettings.ini", "\DiskOnChip\SI\SysInfoSettings.ini")
Copy("\DiskOnChip\SI\Skins\MECA\background.bmp", "\Windows\background.bmp")
Copy("\DiskOnChip\SI\Skins\MECA\PNDbackground.bmp", "\Windows\PNDbackground.bmp")
EndIf
Delete("\Windows\StartUp\showtaskbar.lnk")
Delete("\Windows\StartUp\Restore.lnk")
Sleep (3000)
Copy("\DiskOnChip\Scripts\showtaskbar.lnk", "\Windows\StartUp\showtaskbar.lnk")
BACKUP_MEMORY = 22000
SET SAVEREG, %MORTSCRIPT%&"\savereg.exe"
SET SETMEM, %MORTSCRIPT%&"\SetMem.exe"
Stmp = "\Temp"
Set REGBACKUP, %BACKUP_PATH%&"\backup.rbk"
Call Restore
Exit
Sub Restore    
Run (%SETMEM%, "22000")
If (fileExists(%REGBACKUP%))
	Run (%SAVEREG%,"rd " & %REGBACKUP%)
EndIf
Run (%SETMEM%, %STANDARD_MEMORY%)
EndSub
Exit